﻿Public Class clsGJBinfo

    Public Function getListByDlNo(dl_no As String) As DataTable
        Dim szSql As String = String.Empty
        szSql &= "SELECT a.*,b.material_code as gjb_material_code from sf.b_gjb_dl_info a left join sf.b_gt b on a.b_gt_sys_id = b.sys_id where a.factory_id =? And a.dl_no_lr=? and a.status=? "
        Return DBacs.ExecuteSql(szSql, -1, "TS", dl_no, "0")
    End Function

    Public Sub setdefaultValue(dl_no As String, ByRef txtNum As Object, ByRef txtWeight As Object, Optional xh As Object = Nothing, Optional sys_id As Object = Nothing, Optional txtLabelNo As Object = Nothing)
        Dim szSql As String = String.Empty
        szSql &= "select * from  sf.b_gjb_dl_info where factory_id =? And dl_no_lr=? and status=?	 "
        Dim dt As DataTable = DBacs.ExecuteSql(szSql, -1, "TS", dl_no, "0")
        If dt.Rows.Count > 0 Then
            txtNum.Text = dt.Rows(0)("layer_num")
            txtWeight.Text = dt.Rows(0)("wt")
            If IsNothing(xh) = False Then
                xh.text = dt.Rows(0)("gjb_type")
            End If
            If IsNothing(sys_id) = False Then
                sys_id.text = dt.Rows(0)("sys_id")
            End If
            If IsNothing(txtLabelNo) = False Then
                txtLabelNo.text = dt.Rows(0)("label_no")
            End If
        End If

    End Sub
End Class
